/**
 * 
 */
package niuke;

import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 交错01串 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String string=new Scanner(System.in).nextLine();
		int maxLen=0;
		int curLen=0;
		for (int i = 0; i < string.length(); i++) {
			if(i==0||string.charAt(i-1)!=string.charAt(i)){
				curLen++;
			}else {
				maxLen=Math.max(curLen, maxLen);
				curLen=1;
			}
		}
		maxLen=Math.max(curLen, maxLen);
		System.out.println(maxLen);
	}

}
